<template>
	<view>
		<view class="state-top">
			<view class="text-xxl text-bold margin-bottom-sm">欢迎入驻N家购商家端</view>
			<text class="tips">N家购邀请您来做商家</text>
		</view>
		<view class="state-box bg-white text-center">
			<view class="text-xxl margin-bottom-sm" v-if="statusId ==2">审核中-待审核</view>
			<view class="text-xxl margin-bottom-sm" v-if="statusId ==1">审核失败</view>
			<view class="text-sm text-grey" v-if="statusId ==2">申请成功，我们将3个工作日内完成审核，并尽快与您联系</view>
			<view class="text-sm text-grey" v-if="statusId ==1">很抱歉，您的申请未通过，快去完善您的申请信息吧~</view>
			<view class="text-sm text-grey">如需帮助，可拨打平台客服<text class="text-blue" @click="concat">400-069-0679</text>为您解决~</view>
			<view class="margin-top-sm" v-if="statusId ==1">
				<u-button type="primary" shape="circle" @click="toStepOne">重新申请</u-button>
			</view>
		</view>
		<view class="state-box bg-white" v-if="statusId ==1">
			<view class="failReason">
				失败原因：{{reason}}
			</view>
		</view>
		<view class="bg-white collect-box">
			<view class="top text-sm">
				关注“圣爸爸农业”公众号或收藏小程序提前获取<text class="text-blue">促销和优惠信息</text>
			</view>
			<view class="text-sm text-bold tittle">关注公众号</view>
			<view class="text-sm">关注公众号公众号搜索 [圣爸爸农业] 或扫描以下二维码</view>
			<view class="u-f-ajc"><image src="../../../static/sbb_qrcode.png" mode="aspectFill"></image></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 审核状态 statusId 2 审核中 1 审核失败
				statusId:0,
				reason:''
			};
		},
		onLoad(option) {
			this.statusId = option.wen;
			this.reason = option.reason
		},
		// 页面卸载同时卸载监听事件
		onUnload() {
			uni.$off('reginStatus')
		},
		onShow() {
			uni.$on('reginStatus',(info)=>{  //开启监听全局的审核状态改变事件
				this.statusId=info.statusId
			})
		},
		methods:{
			toStepOne(){
				uni.navigateTo({
					url:'../register/stepOne'
				})
			},
			concat(){
				uni.makePhoneCall({
				    phoneNumber: '4000690679' //仅为示例
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
.state-top{
	background-color: $main-color;
	height: 270rpx;
	color: #fff;
	padding: 40rpx 30rpx;
	.tips{
		background-color: #a0cfff;
		padding: 5rpx 10rpx;
		border-radius: 10rpx;
	}
	
}
.state-box{
	margin: -60rpx 30rpx 30rpx;
	padding: 25rpx;
	border-radius: 28rpx;
}
.collect-box{
	margin: 30rpx;
	padding: 25rpx;
	border-radius: 28rpx;
	.top{
		padding-bottom: 25rpx;
		border-bottom: 1px solid #eee;
	}
	.tittle{
		position: relative;
		margin: 25rpx 0;
	}
	.tittle::before{
		content: '';
		position: absolute;
		top: 4rpx;
		left: -25rpx;
		height: 28rpx;
		width: 6rpx;
		background-color: $main-color;
	}
	image{
		width: 160rpx;
		height: 160rpx;
		margin: 25rpx auto 0;
	}
}
.failReason{
	// position: relative;
	// right: 110px;
	// top: 20px;
	color:#ff0000;
}
</style>
